package 函数式接口.四大函数式接口;

import java.util.function.Function;

public class MyFunction {

    public static void main(String[] args) {
        method(new Function<Integer, String>() {
            @Override
            public String apply(Integer integer) {
                return String.valueOf(integer);
            }
        }, 100);

        method(integer -> String.valueOf(integer), 100);
    }

    public static void method (Function<Integer, String> function, Integer num) {
        String apply = function.apply(num);
        System.out.println(apply);
    }
}
